package com.hyper_yang._03_designpatterns.principles.demo2.before;

/**
 * projectName: com.hyper_yang._03_designpatterns.principles.demo2.before
 *
 * @author: sakiko
 * time: 2025/9/26 0:22
 * description: 正方形类
 */
public class Square extends Rectangle {
    // 长宽一致调用一个就可以
    @Override
    public void setLength(Double length) {
        super.setLength(length);
        super.setWidth(length);
    }

    @Override
    public void setWidth(Double width) {
        super.setLength(width);
        super.setWidth(width);
    }
}
